package com.siyuan.blog.service.system;

import com.siyuan.blog.common.vo.PermissionTreeNode;
import com.siyuan.blog.domain.system.Role;
import com.siyuan.blog.common.base.SuperService;

import java.util.List;


public interface RoleService extends SuperService<Role> {

    /**
     * 保存角色及其权限
     * @param role
     * @param resourcesCodes
     */
    void insert(Role role, String[] resourcesCodes);


    /**
     * 保存角色及其权限
     * @param role
     * @param resourcesCodes
     */
    void update(Role role, String[] resourcesCodes);


    /**
     * 获取权限树
     * @param roleId
     * @return
     */
    List<PermissionTreeNode> permissionTree(Integer roleId);

}
